library(scales)
library(tidyverse)
setwd("~/Dropbox/Mokhtar-Scott/India_Project_ReStat_Publication/replication/")
trade <- read_csv("~/Dropbox/Mokhtar-Scott/India_Project_ReStat_Publication/replication/data/raw/comtrade.csv")
trade <- trade %>% 
  pivot_wider(names_from = partner_iso, values_from = primary_value) %>% 
  mutate(china_share = CHN / W00 * 100,
         CHN = CHN / 1000000000)
ggplot(trade) +
  geom_line(aes(ref_year, CHN), color="blue", size = 1.5) +
  #geom_point(aes(year, CHN)) +
  labs(x = "Year", y = "Billion US Dollars") +
  scale_y_continuous(expand = c(0, 0), limits = c(0, 80)) +
  theme_bw() +
  theme(panel.border = element_blank(), panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"),
        axis.title=element_text(size=14,face="bold"),
        axis.text.x = element_text(hjust = 1, size=12,color="darkred"),
        axis.text.y = element_text(hjust = 1, size=12,color="darkred"))
ggsave("figb1a.png", path = "figures", width = 5, height = 3)

ggplot(trade) +
  geom_line(aes(ref_year, china_share), color="blue", size = 1.5) +
  labs(x = "Year", y = "Chinese Import Share (%)") +
  scale_y_continuous(expand = c(0, 0), limits = c(0, 20)) +
  theme_bw() +
  theme(panel.border = element_blank(), panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"),
        axis.title=element_text(size=14,face="bold"),
        axis.text.x = element_text(hjust = 1, size=12,color="darkred"),
        axis.text.y = element_text(hjust = 1, size=12,color="darkred"))
ggsave("figb1b.png", path = "figures", width = 5, height = 3)

